package com.czl.websocket.controller.api;

import com.czl.common.mvc.RestApiResult;
import com.czl.websocket.server.WebSockeManger;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * @author 石雷
 * shilei1@jiayuan.com
 * 2021/1/22/022 14:58
 */
@RestController
public class ClientHeartbeat {

    /**
     * 发送心跳接口
     * @param uid
     * @return
     */
    @RequestMapping("/alive")
    public RestApiResult alive(String uid){
        WebSockeManger.alive(WebSockeManger.getWebSocketByUid(uid));
        return RestApiResult.create(RestApiResult.RetCode.SUCCESS.getValue(),RestApiResult.RetCode.SUCCESS.getInfo());
    }
}
